#include "gtksizerequest.h"
+#include "gtkbuildable.h"
+
#include "gtkwidgetprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
static GtkSizeRequestMode
gtk_aspect_frame_get_request_mode (GtkWidget *widget);
+static void gtk_aspect_frame_buildable_init (GtkBuildableIface *iface);
#define MAX_RATIO 10000.0
#define MIN_RATIO 0.0001
-G_DEFINE_TYPE (GtkAspectFrame, gtk_aspect_frame, GTK_TYPE_WIDGET)
+
+G_DEFINE_TYPE_WITH_CODE (GtkAspectFrame, gtk_aspect_frame, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ gtk_aspect_frame_buildable_init))
+
static void
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
}
}
+static GtkBuildableIface *parent_buildable_iface;
+
+static void
+gtk_aspect_frame_buildable_add_child (GtkBuildable *buildable,
+ GtkBuilder *builder,
+ GObject *child,
+ const char *type)
+{
+ if (GTK_IS_WIDGET (child))
+ gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (buildable), GTK_WIDGET (child));
+ else
+ parent_buildable_iface->add_child (buildable, builder, child, type);
+}
+
+static void
+gtk_aspect_frame_buildable_init (GtkBuildableIface *iface)
+{
+ parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+ iface->add_child = gtk_aspect_frame_buildable_add_child;
+}
+
/**
* gtk_aspect_frame_new:
* @xalign: Horizontal alignment of the child within the allocation of